package org.zjvis.datascience.common.vo.kg;

import cn.weiguangfu.swagger2.plus.annotation.ApiRequestExclude;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.zjvis.datascience.common.dto.kg.DataPushDTO;
import org.zjvis.datascience.common.util.DozerUtil;
import org.zjvis.datascience.common.vo.BaseVO;

import java.time.LocalDateTime;


/**
 * @description 知识图谱数据推送VO
 * @date 2022-03-28
 */
@Data
@NoArgsConstructor
public class DataPushVO extends BaseVO {

    private Long id;

    private Long userId;

    private Long projectId;

    @ApiRequestExclude(groups = {Ignore.class})
    @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime due;

    private JSONObject dataPushInfo;

    private String expectation;

    private int status;

    private Long kgId; //knowledge graph id

    private String name;

    public DataPushDTO toDataPush() {
        DataPushDTO dp = DozerUtil.mapper(this, DataPushDTO.class);
        dp.setDataPushInfo(dataPushInfo.toJSONString());
        return dp;
    }
}
